﻿using System;
using System.Collections.Generic;
using System.Linq; 
using NTTDATA.BEENChina.ResultCertification.Config;

namespace NTTDATA.BEENChina.ResultCertification.Checker.Date
{
    [Serializable]
    [VerfityAttribute(Id = "VerfityRq0204", Name = "日栏记载_多录检证", CategoryType = EnumCategoryType.日期, Model = true)]
    public class VerfityRq0204:VerfityOneResult
    {



        public override bool CheckResult(List<List<string>> result, string entryCommon)
        {
            bool bresult = false;

            foreach (var rowResult in result)
            {
                

                //for debug
                foreach (var entryResult in rowResult)
                {


                    //得到日位置
                    List<string> arrayDateFormat = ChildImageObject.CategorySetting.DataFormat.Split(new char[] { '/' }).ToList();

                    int indexdd = arrayDateFormat.IndexOf("dd");


                    if (indexdd > -1)
                    {
                        //拆分结果
                        List<string> entry = entryResult.Split(new char[] { '/' }).ToList();


                        string dd = entry[indexdd];

                        //日期有值
                        bresult = !string.IsNullOrEmpty(dd);

                        //if (bresult)
                        //{
                        //     System.Console.WriteLine( string.Format("ca:{0} dd:{1}",ChildImageObject.CategoryId,dd));
                        //} 

                    }

                    if (bresult)
                        break;

                }

                if (bresult)
                    break;
            }

            
  

            if (bresult)
            {
                System.Console.WriteLine("VerfityRq0203");
            }

            return bresult;   
        }
         

        

    }
}